package com.example.shop.user.config;

import com.example.shop.user.listener.UserSessionListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class UserSessionConfig {

    @Autowired
    UserSessionListener userSessionListener;
    @Bean
    public ServletListenerRegistrationBean<UserSessionListener> ServletListenerRegistrationBean(){
        ServletListenerRegistrationBean<UserSessionListener> listenerRegister = new ServletListenerRegistrationBean<>();
        listenerRegister.setListener(userSessionListener);
        return listenerRegister;
    }

}
